{include file="company/head" /}
<body class="body_style">
{include file="company/menu" /}
<div class="member">
    <div class="wrap">
        <div class="aside">
            {include file="company/left" /}
        </div>
    </div>
    <div class="page">
        <div class="top">
            <div class="p1">我的资产数据</div>
            <div class="p2">
                <div class="left">
                    <div class="money">{$data.money}</div>
                    <p>我的余额（元）</p>
                </div>
                <div class="right">
                    <a href="{:url('Company/recharge')}" class="cz">充值</a>
                    <a href="{:url('Company/getcash')}" class="tx">提现</a>
                    <a href="{:url('Company/right')}" class="tx">对账</a>

                </div>
            </div>
        </div>
        <div class="setting">
            <div class="middle">
                <div class="left">
                    <div class="userhead" id="tochangehead" style="cursor:pointer;background: url('{$member.head_thumb}') center no-repeat;background-size: cover"><span>修改头像</span></div>
                    <div class="username"></div>
                </div>
                <div class="right">
                    <ul>
                        <li>
                            <div class="tip">公司名</div>
                            <div class="info"><span>{$data.companyname}</span></div>
                        </li>
                        <li>
                            <div class="tip">法人</div>
                            <div class="info"><span>{$data.username}</span></div>
                        </li>
                        <li>
                            <div class="tip">法人手机号</div>
                            <div class="info"><span>{if $data.is_check}{$data.mobile}{else}未认证{/if}</span></div>
                        </li>
                        <li>
                            <div class="tip">企业银行卡</div>
                            <div class="info"><span class="old-info">{:getXXtel($data.card)}</span></div>
                        </li>
                    </ul>
                </div>
                <!--点击修改头像-->
                <div class="alert">
                    <div class="mask">
                        <form action="{:url('company/headimg')}" class="box" method="post" enctype="multipart/form-data">
                            <div class="headline">
                                <span class="fl">上传头像</span>
                                <span class="fr" id="close"></span>
                            </div>
                            <div class="add">
                                <div class="icon"></div>
                                <p>添加图片</p>
                                <p>只支持JPG、PNG、GIF，大小不超过2M</p>
                                <p>建议尺寸为240x240</p>
                                <input type="file" id="picture" name="photo">
                            </div>
                            <div class="show">
                                <div class="pic"><img id="picpreview" src="{$member.head_thumb}" alt=""></div>
                                <p>头像预览</p>
                            </div>
                            <div class="clear"></div>
                            <div class="btns">
                                <input type="submit" id="picUpload" value="确定">
                                <input type="reset" value="取消" id="cancle">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="clear">

</div>
</div>
</div>
{include file="public/foot" /}
</body>
{include file="public/load_bottom" /}
<script src="__static__/hry/dist/clipboard.min.js"></script>
<script>
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#start'
        });
        laydate.render({
            elem: '#end'
        });
    });


    $(function () {

        // 上传头像
        $("#picture").change(function () {
            var s = $('#picture').val();
            var start = s.indexOf(".") + 1;
            var name = s.substring(start, s.length).toLowerCase();
            if (name != "jpg" && name != "png" && name != "gif") {
                alert("图片格式必须为jpg、png、gif中的一种");
                $("#picUpload").attr("disabled", true);
                return;
            }
            if (this.files[0].size / 1024 / 1024 > 5) {
                alert("图片不能超过5M");
                $("#picUpload").attr("disabled", true);
                return;
            }
            var objUrl = getObjectURL(this.files[0]);
            if (objUrl) {
                $("#picpreview").attr("src", objUrl);
            }
            $("#picUpload").attr("disabled", false);
        });
        // 取消
        $('#cancle').click(function(){
            $("#picpreview").attr("src", '__static__/hry/images/userhead_03.png');
        })
        function getObjectURL(file) {
            var url = null;
            if (window.createObjectURL != undefined) { // basic
                url = window.createObjectURL(file);
            } else if (window.URL != undefined) { // mozilla(firefox)
                url = window.URL.createObjectURL(file);
            } else if (window.webkitURL != undefined) { // webkit or chrome
                url = window.webkitURL.createObjectURL(file);
            }
            return url;
        }
        $('#close').click(function () {
            $('.alert').fadeOut(200)
        })
        $('#tochangehead').click(function () {
            $('.alert').fadeIn(200)
        })
        $("#Share").click(function () {
            layer.open({
                type: 2,
                title: '分享',
                shadeClose: true,
                shade: 0.8,
                area: ['380px', '50%'],
                content: "{:url('About/share')}"
            });
        })
    })
</script>
</html>